import { Button } from "antd";
import { useSelector } from "react-redux";

const page = () => {
  let date: Date;
  let YY: string | number;
  let MM: string | number;
  let DD: string | number;
  let ss: string | number;
  let ff: string | number;
  let mm: string | number;

  function time() {
    date = new Date();
    YY = date.getFullYear();
    MM = JSON.stringify(date.getMonth() + 1).padStart(2, "0");
    DD = JSON.stringify(date.getDate()).padStart(2, "0");
    ss = JSON.stringify(date.getHours()).padStart(2, "0");
    ff = JSON.stringify(date.getMinutes()).padStart(2, "0");
    mm = JSON.stringify(date.getSeconds()).padStart(2, "0");
    console.log(YY, MM, DD, ss, ff, mm);
  }

  const { number } = useSelector((state: { number: any }) => ({
    number: state.number,
  }));
  time();
  return (
    <div>
      <p>我是page的組件</p>
      <p>{number}</p>
    <Button>按钮</Button>
    </div>
  );
};

export default page;
